//
//  Game3TableViewCell.m
//  GOGOTravel
//
//  Created by dllo on 16/2/2.
//  Copyright © 2016年 果果. All rights reserved.
//

#import "Game3TableViewCell.h"

@implementation Game3TableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
    }
    return self;
}

- (void)setModel:(Days *)model{
    
    if (_model != model) {
        [_model release];
        _model = [model retain];
        
    }
    _view1.layer.cornerRadius = 10;
    _view1.layer.masksToBounds = YES;
    _view1.layer.shadowOffset = CGSizeMake(10, 10);
    _view1.layer.shadowColor = [UIColor lightGrayColor].CGColor;
    _view2.layer.cornerRadius = 10;
    _view2.layer.masksToBounds = YES;
    [self setValues];
}

- (void)setValues{
    
    _image1.image = [UIImage imageNamed:@"iconfont-shijian.png"];
//    日期赋值
    NSString *day = [_model.day stringValue];
    NSString *str = [NSString stringWithFormat:@"第 %@ 天", day];
    NSString *date = [_model.local_time substringToIndex:10];
    NSString *result = [NSString stringWithFormat:@"%@ %@", str , date];
    _label1.text = result;
    
    _label2.text = _model.text;
    
    _image2.image = [UIImage imageNamed:@"iconfont-shijian.png"];
    _label3.text = _model.local_time;
    
    _image3.image = [UIImage imageNamed:@"iconfont-huoche.png"];
    NSDictionary *dic = _model.poi;
    _label4.text = dic[@"name"];
    
}

- (void)dealloc{
    [_image1 release];
    [_label1 release];
    [_view1 release];
    [_label2 release];
    [_image2 release];
    [_label3 release];
    [_view2 release];
    [_image3 release];
    [_label4 release];
    [super dealloc];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
